home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 3
/
Risc World 3.iso
/
SOFTWARE
/
ISSUE3
/
PD
/
NEWALARM
/
!NewAlarm
/
Generator
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
2000-09-10
|
3KB
|
142 lines
>NewAlarm file generator
d%(5)
$;" at line ";
interval$(6)
interval$(1)="minutes"
interval$(2)="hours"
interval$(3)="days"
interval$(4)="weeks"
interval$(5)="months"
interval$(6)="years"
days$="MTWTFSS"
"New alarms file(1)"'"Read back alarms(2)"'"Add alarms(3)"
a$=
"1":
"2":
"3":
count%=0
"<NewAlarm$Dir>.Alarms"
closefile:
$;" at line ";
#i%,0:
insert dummy number of alarms
getalarms
getalarms
'"Entering Alarms:"'
"Hours (out of 24)",hrs%
"Minutes (multiple of 5)",mins%
"Day N
(of month)",dy%
"Month N
"Year",yr%
"Text of alarm",txt$:
in case of commas
"Line 2",txt2$
"Line 3",txt3$
time(mins%,hrs%,dy%,m%,yr%)
#i%,txt$+
(9)+txt2$+
(9)+txt3$
"Repeat",yn$
UPPER(yn$)="Y"
repeat
n%=1
#i%,0:
count%+=1
"#####"'"Define another alarm (Y/N)":yn$=
6) yn$=
UPPER(yn$):
Force to capitals
yn$<>"Y"
'"Finished entering alarms"'
closefile
time(d%(1),d%(2),d%(3),d%(4),year%)
n%,a$
n%=1
a$=
(65+d%(n%))+a$
(65+year%-1990)+a$
decodetime(code$)
n%=1
d%(n%)=
code$,n%,1))-65
(d%(4))+":"+
(d%(5))+" "+
(d%(3))+"/"+
(d%(2))+"/"+
(d%(1)+1990)
closefile
#i%=0
#i%,count%
n%,a$,m%,type%
"<NewAlarm$Dir>.Alarms"
#i%,count%
n%=1
count%
#i%,a$
#i%,txt$
"DATE ";
decodetime(a$)
"MESSAGE:";txt$
type%=
#i%:m%=
type%
[4
"Repeats every ";
(m%);" ";interval$(type%)
]% m%=
readdays(m%):m%=
"<NewAlarm$Dir>.Alarms"
i%=0
"Alarm file not found! Starting new alarm file.":
#i%,count%
getalarms
repeat
a$,int$,X%,Y%,type%
"Interval -(M)inutes/(H)ours/(D)ays/(W)eeks/mo(N)ths/(Y)ears"
a$=
UPPER(a$)
"M" :type%=1
"H" :type%=2
"D" :type%=3
"W" :type%=4
"N":type%=5
"Y" :type%=6
:a$="error":
a$<>"error"
z!Y%=
17);interval$(type%);
0,Y%)"Repeat every";X%
#i%,type%
#i%,X%
"On which days? Enter first letter of day"'"or dash if alarm is not to go off"'"(default 'MTWTF--')",a$
(a$)<>7
"Using default (working week only)":a$="MTWTF--"
writedays(a$)
#i%,0:
fill in rest of word
writedays(code$)
m%,n%
n%=0
a$,n%+1,1)="-"
m%+=(1<<n%)
readdays(byte%)
n%,a$
byte%=0
="*******"
n%=0
byte%
(1<<n%)
a$+="-"
a$+=
days$,n%+1,1)
UPPER(string$)
X%,n%
n%=1
(string$)
string$,n%))
(X%>&60
X%<&B7)
string$,n%)=
=string$